Examples
examples.RmdBackground
Haiti is a island state in the Caribbean sea. It has four administrative levels where the 3rd level is used to emphasize the data through out this article. The 3rd administrative level contains 134 areas. For this article the extended area around Cap Haïtien and l’Acul-du-Nord has been explored as depicted in @fig-northern-area.
### explore Cap-Haitien data
# view(haiti_adm3)
# explore Haiti adm3 area data
tmap_mode("view")
#> tmap mode set to interactive viewing
haiti_adm3 |>
tm_shape() +
tmap_options(check.and.fix = TRUE) +
tm_borders() +
tm_fill(col = "orange", alpha = 0.6) +
tm_shape(filter(haiti_adm3, (ID_2 == 24 | ID_2 == 25) & ID_3 != 76 & ID_3 != 80)) +
tm_borders() +
tm_fill(col = "yellow", alpha = 0.6)
#> Warning: The shape haiti_adm3 is invalid. See sf::st_is_valid
# find Cap-Haitien data
# mwater |>
# tabyl(Administra)
# okap |>
# tabyl(cte)


Used datasets
okap
as_tibble(okap)
#> # A tibble: 198 × 21
#> neighborho name sup_km2 sector_id cte qlty_water qty_water health_car
#> <dbl> <chr> <dbl> <dbl> <chr> <dbl> <dbl> <dbl>
#> 1 10 Blue Hills 2.47 NA ctec… 2.06 3.42 4.16
#> 2 21 Carénage 0.961 NA ctec… 1.5 3.5 4.43
#> 3 37 Anba Sali… 0.390 NA ctec… 3.5 2.7 3.5
#> 4 53 Centre-Vi… 0.268 NA ctem… NA NA NA
#> 5 60 Artibopla… 0.578 NA ctem… NA NA NA
#> 6 279 Charrier 0.414 NA ctec… 1.75 3.5 4
#> 7 187 Village N… 0.599 NA ctec… NA NA NA
#> 8 198 Quartier … 2.95 NA ctec… NA NA NA
#> 9 238 Bel Air 0.693 NA ctec… 1.93 4 5.79
#> 10 282 Babiole 0.928 NA ctec… 1.63 3.59 4.5
#> # ℹ 188 more rows
#> # ℹ 13 more variables: schooling <dbl>, transport <dbl>, economy <chr>,
#> # ranking <dbl>, sup_bati <dbl>, density <fct>, aptitude <chr>, zoning <chr>,
#> # latrine <chr>, standing <chr>, density_ra <dbl>, economy_nu <dbl>,
#> # geometry <POLYGON [m]>
mwater
as_tibble(mwater)
#> # A tibble: 1,849 × 7
#> Latitude.o Longitude Administra Type Date.added Datasets..
#> <dbl> <dbl> <chr> <chr> <chr> <chr>
#> 1 19.7 -72.2 3e Section Genipailler, Mil… Bore… 7/28/20 2… Inventair…
#> 2 19.7 -72.2 3e Section Genipailler, Mil… Prot… 10/25/16 … FRAPE (Ha…
#> 3 19.7 -72.2 3e Section Genipailler, Mil… Bore… 10/27/16 … FRAPE (Ha…
#> 4 19.7 -72.2 3e Section Genipailler, Mil… Bore… 10/25/16 … FRAPE (Ha…
#> 5 19.7 -72.2 3e Section Genipailler, Mil… Bore… 7/28/20 2… Inventair…
#> 6 19.7 -72.2 3e Section Genipailler, Mil… Other 9/30/21 1… NA
#> 7 19.7 -72.2 3e Section Genipailler, Mil… Prot… 10/27/16 … FRAPE (Ha…
#> 8 19.7 -72.2 3e Section Genipailler, Mil… Bore… 10/25/16 … FRAPE (Ha…
#> 9 19.7 -72.2 1re Section Basse Plaine (Q… Bore… 7/28/20 2… Inventair…
#> 10 19.7 -72.2 3e Section Petit Anse, Cap … Bore… 7/28/20 2… Inventair…
#> # ℹ 1,839 more rows
#> # ℹ 1 more variable: geometry <MULTIPOINT [m]>Haiti 3rd level administrative areas haiti_adm3
as_tibble(haiti_adm3)
#> # A tibble: 134 × 16
#> ID_0 ISO NAME_0 ID_1 NAME_1 ID_2 NAME_2 ID_3 NAME_3 CCN_3 CCA_3 TYPE_3
#> <dbl> <chr> <chr> <dbl> <chr> <dbl> <chr> <dbl> <chr> <dbl> <chr> <chr>
#> 1 99 HTI Haiti 1 Centre 1 Cerca … 1 Cerca… 0 NA Commu…
#> 2 99 HTI Haiti 1 Centre 1 Cerca … 2 Thoma… 0 NA Commu…
#> 3 99 HTI Haiti 1 Centre 2 Hinche 3 Cerca… 0 NA Commu…
#> 4 99 HTI Haiti 1 Centre 2 Hinche 4 Hinche 0 NA Commu…
#> 5 99 HTI Haiti 1 Centre 2 Hinche 5 Maïss… 0 NA Commu…
#> 6 99 HTI Haiti 1 Centre 2 Hinche 6 Thomo… 0 NA Commu…
#> 7 99 HTI Haiti 1 Centre 3 Lascah… 7 Bella… 0 NA Commu…
#> 8 99 HTI Haiti 1 Centre 3 Lascah… 8 Lasca… 0 NA Commu…
#> 9 99 HTI Haiti 1 Centre 3 Lascah… 9 Savan… 0 NA Commu…
#> 10 99 HTI Haiti 1 Centre 4 Mireba… 10 Bouca… 0 NA Commu…
#> # ℹ 124 more rows
#> # ℹ 4 more variables: ENGTYPE_3 <chr>, NL_NAME_3 <chr>, VARNAME_3 <chr>,
#> # geometry <MULTIPOLYGON [°]>